<!--
  ~ Copyright 2010 Pierre Heinzerling, Uwe Janner, Patrick Wright
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~        http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  -->

<!DOCTYPE html>
<html>
<head>
	<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.js"></script>
	<script type="text/javascript" src="js/util.js"></script>
	<script type="text/javascript" src="js/local-storage.js"></script>
	<script type="text/javascript" src="js/toolinsky-server.js"></script>
	<script type="text/javascript" src="js/popup.js"></script>
	<link type="text/css" rel="stylesheet" href="css/popup.css">
	<title>Popup</title>
</head>
<body>
<div>
	<!--
	Display for current URL/link
	-->
	<img src="icons/wait16trans.gif" id="waiting_img"/>

	<div id="icon_bar">
		<a class="default_hidden" id="switch_to_scratchpad_div" href="#" onclick="switchToScratchpad()" title="Switch to ScratchPad">
			<img src="icons/script_edit.png" />
		</a>
		<a class="default_hidden" id="show_overview_div" href="#" onclick="showOverviewPage()" title="Open links overview page in new tab">
			<img src="icons/report.png" />
		</a>
		<a class="default_hidden" id="open_all_div" href="#" onclick="openAllInNewTabs()" title="Open each link in a new tab">
			<img src="icons/layers.png" />
		</a>
		<a id="loginStateLink" href="#" >
			<img id="loginStateIcon" src="icons/disconnect.png" />
		</a>
	</div>

	<p id="current_context"></p>
	<span id="theme_owner"></span>
	<span class="default_hidden" id="decline_theme_div"></span>
	<a href="#" class="collapser collapserOpen">Current Page</a>

	<div class="collapsible" id="currentPageCtn">
		<div id="currentPageCtnForm">
			<input type="hidden" id="link_id" value=""/>
			<input type="hidden" id="current_url"/>

			<label for="current_title">Title</label>
			<input class="inputElement" id="current_title" />

			<label for="display_url">Url</label>
			<span id="display_url">&nbsp;</span>

			<label for="note">Notes / Tags</label>
			<textarea rows="5" cols="40" id="note" class="inputElement"></textarea>

			<div id="other_user_notes"></div>
			<div style="text-align: right"><input type="button" value="save" class="formBtn" onclick="applyChangesToCurrentLink()" /></div>
		</div>
		<div id="currentPageCtnLoader">
			<img src="icons/wait16trans.gif" /> Loading...
		</div>
	</div>

	<!--
	links table for current theme
	-->
	<div id="current_links">
		<a href="#" class="collapser collapserOpen">This Theme</a>
		<div class="collapsible">
			<div id="no_links">You have no links for this Theme yet :(</div>
			<div id="links_table"></div>

			<!-- or, if i have selected a theme, show the theme desc, etc. -->
			<div class="default_hidden" id="current_theme_div">
				<label for="submit_invitation">Share with a Friend (EMail)</label>
				<input type="text" id="submit_invitation" value="myfriend@gmail.com" class="inputElement" />
				<input type="button" value="invite" class="formBtn" onclick="postNewInvitation()" />
				<div id="invites_from_desc"></div>
			</div>
		</div>
	</div>

	<!--
	theme panels
	-->
	<a href="#" id="otherThemes" class="collapser collapserClosed">Other Themes</a>
	<div id="view_themes_div" class="default_hidden collapsible">
		<!-- other themes i can choose from -->
		<div class="default_hidden" id="themes_div">
			<span id="themes_desc"></span>
		</div>
		<!-- invitations from other people -->
		<div class="default_hidden" id="invites_div">
			You are invited to:
			<span id="invites_open"></span>
		</div>

		<div class="default_hidden" id="new_theme_div">
			<input type="text" id="submit_theme_name" class="inputElement" />
			<input type="button" value="Create Theme" class="formBtn" onclick="postNewTheme()" />
		</div>
	</div>
</div>
</body>
</html>